using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ParticleManager : MonoBehaviour
{
    private ParticleSystem _particle;
    private ParticleSystem.MainModule _mainModule;

    private void Start()
    {
        _particle = transform.GetComponent<ParticleSystem>();
        _mainModule = _particle.main;
        _mainModule.loop = false;
        _mainModule.stopAction = ParticleSystemStopAction.Callback; //设置结束时调用回调
    }

    public void OnParticleSystemStopped()
    {
        //Debug.LogError($"Stopped：{gameObject.name}");
        ObjectPool.GetInstance().RecycleGo(gameObject);
    }
}